import Vue from 'vue'
import Router from 'vue-router'
 
Vue.use(Router)

const routers =  new Router ({
    // mode: 'history',   // 此处用history路由，点击切换之后将会跳转到主应用的路由。但是，使用hash的路由不会跳转到主应用。但是，官网所显示的是推荐使用history
    base: window.__POWERED_BY_QIANKUN__ ? "/app1" : "/",
    routes: [
        {
            path: '/',
            component: () => import('@/pages/index.vue'),
            children: [
                {
                    path: '/',
                    component: () => import('@/pages/home.vue'),
                },
                {
                    path: '/weiMenu1',
                    component: () => import('@/pages/menu1.vue')
                },
                {
                    path: '/weiMenu2',
                    component: () => import('@/pages/menu2.vue')
                }
            ]
        }
    ]
})

export default routers